<?php
use app\middleware\JwtAuth;
use app\middleware\Cors;
use think\facade\Route;


Route::post('common/upload/images', 'Upload/images')->middleware(Cors::class);
// 文件上传
Route::post('common/upload', 'Utils/upload')->middleware(Cors::class);


// 用户路由
Route::group('user', function () {
//    用户注册
	Route::post('register', 'HomeMuser/register');
//    用户登录
	Route::post('login', 'HomeMuser/login');
	Route::post('list', 'HomeMuser/list');
	Route::post('reset', 'HomeMuser/reset')->middleware(JwtAuth::class,Cors::class);
	Route::post('info', 'HomeMuser/info')->middleware(JwtAuth::class,Cors::class);
	Route::post('friend/info', 'HomeMuser/friendInfo')->middleware(JwtAuth::class,Cors::class);
	Route::get('nav/list', 'HomeMusernav/list')->middleware(JwtAuth::class,Cors::class);
	Route::post('friend/add', 'HomeMuserfriend/add')->middleware(JwtAuth::class,Cors::class);
	Route::get('friend/list', 'HomeMuserfriend/list')->middleware(JwtAuth::class,Cors::class);
	Route::post('chart/list', 'HomeChartmessages/list')->middleware(JwtAuth::class,Cors::class);
})->prefix('user/');

//    获取季节最需
Route::get('mostneeded/list', 'HomeMostneeded/list')->middleware(Cors::class);
//    获取首页导航
Route::get('nav/list', 'HomeNav/list')->middleware(Cors::class);

// 需求管理
Route::group('requirement',function(){
	Route::post('list', 'HomeRequirement/list');
	Route::post('detail', 'HomeRequirement/detail');
	Route::post('add', 'HomeRequirement/add');
	Route::post('udp', 'HomeRequirement/update');
	Route::post('del', 'HomeRequirement/del');
	Route::post('history', 'HomeRequirement/history');
	Route::post('status', 'HomeRequirement/status');
	Route::post('accept', 'HomeRequirement/accept');
	Route::post('completion', 'HomeRequirement/completion');
	Route::post('serverNoList', 'HomeRequirement/serverNoList');
	Route::post('serverOkList', 'HomeRequirement/serverOkList');
})->prefix('requirement/')
->middleware(JwtAuth::class,Cors::class);

// 需求评论管理
Route::group('requicomment',function(){
	Route::get('list', 'HomeRequicomment/list');
	Route::post('add', 'HomeRequicomment/add');
	Route::post('udp', 'HomeRequicomment/update');
	Route::post('del', 'HomeRequicomment/del');
})->prefix('requicomment/')->middleware(JwtAuth::class,Cors::class);

// 兑换商品管理
Route::group('exchanmall',function(){
	Route::get('list', 'HomeExchanmall/list');
	Route::post('add', 'HomeExchanmall/add');
	Route::post('shop', 'HomeExchanmall/shop');
	Route::post('udp', 'HomeExchanmall/update');
	Route::post('del', 'HomeExchanmall/del');
	Route::post('history', 'HomeExchanmall/history');
})->prefix('exchanmall/')->middleware(JwtAuth::class,Cors::class);

Route::get('residentialType/list', 'HomeJuzhutype/list')->middleware(Cors::class);
Route::post('acceptdemand/add', 'HomeAcceptdemand/add')->middleware(JwtAuth::class,Cors::class);


